{% load i18n forum_tags %}
{% if object_list %}
<table class="table table-bordered table-condensed">
    <thead>
        <tr>
            <th></th>
            <th class="number-column center smaller hidden-phone">{% trans "Replies" %}</th>
            <th class="number-column center smaller hidden-phone">{% trans "Views" %}</th>
            <th class="last-post center">{% trans "Last post" %}</th>
        </tr>
    </thead>
    <tbody>
    {% for topic in object_list %}
        <tr {% if topic|has_unread:user %}class="success"{% endif %}>
            <td class="topic-name">
                {% include 'djforum/_topic_statuses.html' %}
                <a href="{{ topic.get_absolute_url }}" class="forum-title">{{ topic }}</a>
                {% if show_info == "yes" %}<p><i class="smaller fa fa-pencil"></i> {{ topic.forum }}</p>{% endif %}
            </td>
            <td class="smaller center hidden-phone">{{ topic.reply_count }}</td>
            <td class="smaller center hidden-phone">{{ topic.views }}</td>
            <td class="smaller last-post">
                {% with last_post=topic.last_post %}
                {% if last_post %}
                    <a href="{{ last_post.get_absolute_url }}">
                        <i class="fa fa-clock-o"></i> {{ last_post.created|date:'DATETIME_FORMAT' }}
                    </a><br>
                    <a href="{{ last_post.get_absolute_url }}"><i class="fa fa-pencil"></i>  {{ last_post.user|softwraphtml }}</a>
                {% endif %}
                {% endwith %}
            </td>
        </tr>
        {% if forloop.counter == 5 %}<tr><td colspan="4">{% include "_yandex.html" with index=forloop.counter %}</td></tr>{% endif %}
        {% if forloop.last and object_list|length > 10 %}<tr><td colspan="4">{% include "_yandex.html" with index=forloop.counter %}</td></tr>{% endif %}
    {% endfor %}
    </tbody>
</table>
{% else %}
    <div class="clearfix"></div>
    <p>{% trans "No topics" %}</p>
{% endif %}
